home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / Perl_WWW_Utilities / total / search / README next >
Encoding:
Text File  |  1996-01-02  |  6.1 KB  |  140 lines

  1. #############################################################################
  2. # Simple Search Script
  3. # Written By Matt Wright
  4. # Created on: 12/16/95    Last Modified on: 12/16/95
  5. # Version 1.0
  6. # I can be reached at:        mattw@misha.net
  7. # Scripts found at:        http://www.worldwidemart.com/scripts/
  8. ##############################################################################
  9. # If you run into any problems while trying to configure this scripts, help  #
  10. # is available.  The steps you should take to get the fastest results, are:  #
  11. #       1) Read this file thoroughly                         #
  12. #       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
  13. #               http://www.worldwidemart.com/scripts/faq/                 #
  14. #       3) If you are still having difficulty installing this script, send   #
  15. #          e-mail to: scripts-help@tahoenet.com                     #
  16. #          Include any error messages you are receiving and as much detail   #
  17. #          as you can so we can spot your problem.  Also include the variable#
  18. #          configuration block that is located at the top of the script.     #
  19. #                                         #
  20. # Hopefully we will be able to help you solve your problems.  Thank you.     #
  21. ##############################################################################
  22.  
  23.     The simple search script was written to allow people to set up a 
  24. search of their site, so their users could enter keywords and find all 
  25. documents matching those keywords.  It was written to be simple, so there 
  26. are not many options.  When the search returns pages, it returns them in 
  27. no real order, and they are referenced with the <title> tag of that page.
  28.  
  29.     The instructions below explain how to set up and configure the 
  30. Simple Search script.  The script should have come with three files:
  31.  
  32.     1) README     - Useful installation instructions.
  33.     2) search.pl     - The Perl script which does the searching.
  34.     3) search.html  - A sample HTML Search Page.
  35.  
  36. SEARCH.PL
  37. =========
  38.  
  39.     This script is the one that you will need to define what files 
  40. you want to be searched and the locations of those files.  First you need 
  41. to define the variables:
  42.  
  43.     $basedir = '';
  44.         This is the base directory to the files you will want to 
  45.        search.  If you have all of your files in /home/joe/public_html
  46.        and you want to search files that are in 
  47.        /home/joe/public_html/work and /home/joe/public_html/fun, then
  48.        you would set your base directory at /home/joe/public_html/ and
  49.        then put subdirectories into the @files array, since they will be 
  50.        put together at run time.  The $basedir variable just saves you the 
  51.        time of having to type out the basedir over and over again for 
  52.        every file you want to include.
  53.  
  54.     $baseurl = '';
  55.         This is very similar to the basedir variable except that 
  56.        it will be used as a base reference to the files you want to search
  57.        in terms of the web.  For the example above with user joe, his 
  58.        baseurl would probably be something like: http://joe.host.com/~joe/ 
  59.        so that when the searched files are appended to this baseurl, they 
  60.        form a complete url to his files to place in the results.
  61.  
  62.     @files = ();
  63.         This is an array that includes all of the files you want 
  64.        to search.  The directory paths and filenames should be in 
  65.        reference to $basedir.  Wild cards are allowed in this array, so if 
  66.        joe wanted to search all html files in fun/ and work/, he would set 
  67.        his @files array up as: @files = ('fun/*.html','work/*.html');  You 
  68.        can also search whole directories at one time, like: @files = 
  69.        ('fun/','work/');  This would search all text files located in these 
  70.        directories.  Putting exact filenames will search only that filename.
  71.  
  72.     $title = "";
  73.         This variable is used to display the title of your page 
  74.        in the search results and used to link back to your main page.
  75.  
  76.     $title_url = '';
  77.         This is the url that would link to the page $title.
  78.  
  79.     $search_url = '';
  80.         This is the url to the search.html page you set up, so 
  81.        that it can be referenced from in the results page if users want
  82.        to make another search.
  83.  
  84.     That is all of the variables that need to be configured in your 
  85. script.  You must also chmod this script to 755 so that all users can 
  86. execute it and place it in your cgi-bin or change the name to 
  87. search.cgi.  Now you simply have to edit the search.html page and you are 
  88. ready to go!
  89. ------------------------------------------------------------------------------
  90.  
  91. SEARCH.HTML
  92. ===========
  93.  
  94.     This page needs only a little changing.  You will probably want 
  95. to change the title and header of this page to match your site, and you 
  96. may want to change the background and other features of it to make it fit 
  97. into your site better.
  98.  
  99.     The main thing you will need to change is the action="" of your 
  100. script from the fake url, to the url of your search.pl script.  Once you 
  101. have changed this, and have implemented the changes listed above in 
  102. search.pl, the search program should work.
  103.  
  104.     search.html should be chmoded 744 so that it is readable by everyone.
  105. ------------------------------------------------------------------------------
  106.  
  107. README
  108. ======
  109.  
  110.     Just read it!
  111. ------------------------------------------------------------------------------
  112.  
  113. HISTORY
  114. =======
  115.  
  116. Version 1.0    -    12/16/95    - First Version Released.
  117.  
  118. ------------------------------------------------------------------------------
  119.  
  120.     If you have any questions about setting up or implementing this 
  121. script feel free to mail me at the address at the top of this file AFTER 
  122. you have read the Frequently Asked Questions located at:
  123.  
  124.     http://www.worldwidemart.com/scripts/faq/
  125.  
  126. ------------------------------------------------------------------------------
  127.  
  128. Feel free to change/hack/modify whatever this script, but please leave 
  129. my name and url in it at all times.  If you end up implementing this 
  130. script on a page, please let me know by filling out the form located at:
  131.  
  132.     http://www.worldwidemart.com/scripts/implement.html
  133.  
  134. Feel free to link back to my site at the bottom of your page if you enjoy 
  135. these scripts and use them, although it is not required.  And most of all 
  136. Have fun!
  137.  
  138. ------------------------------------------------------------------------------
  139. Matt Wright - mattw@misha.net - http://www.worldwidemart.com/scripts/
  140.